package org.exteen;

import java.io.Writer;

import org.exteen.output.ExteenStream;
import org.exteen.output.FlatExteenStream;
import org.exteen.output.NiceXmlExteenStream;
import org.exteen.output.FlatExteenStream.TrimType;

public class ExteenStreamFactory {

    private TrimType type = null;
    private String indent = null;

    public ExteenStream buildExteenStream(Writer w) {
        if (indent != null) {
            return new NiceXmlExteenStream(w, indent);
        }
        if (type != null) {
            return new FlatExteenStream(w, type);
        }
        return new ExteenStream(w);
    }

    public void setFlatExteenType(FlatExteenStream.TrimType type) {
        this.type = type;
    }

    public void setNiceExteenIndentString(String indent) {
        this.indent = indent;
    }
}
